home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / vbdatabs / crc32.h < prev    next >
C/C++ Source or Header  |  1999-03-14  |  2KB  |  47 lines

  1. // ------------------------------- //
  2. // -------- Start of File -------- //
  3. // ------------------------------- //
  4. // ----------------------------------------------------------- //
  5. // C++ Header File Name: crc32.h 
  6. // Compiler Used: MSVC40, DJGPP 2.7.2.1, GCC 2.7.2.1, HP CPP 10.24
  7. // Produced By: Doug Gaer    
  8. // File Creation Date: 08/17/1998 
  9. // Date Last Modified: 03/15/1999
  10. // ----------------------------------------------------------- // 
  11. // ---------- Include File Description and Details  ---------- // 
  12. // ----------------------------------------------------------- // 
  13. /*
  14. THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND.
  15. THE ENTIRE RISK OF THE QUALITY AND PERFORMANCE OF THIS SOFTWARE
  16. IS WITH YOU. SHOULD ANY ELEMENT OF THIS SOFTWARE PROVE DEFECTIVE,
  17. YOU WILL ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR
  18. CORRECTION.
  19.  
  20. The CRC32 functions (Cyclic Redundancy Check) are used to
  21. calculate a sophisticated checksum based on the algebra of
  22. polynomials. The Cyclic Redundancy Check, is a way to detect
  23. bit errors that occur during data storage or transmission.
  24. The CRC-32 algorithm operates on a block of data as a single
  25. large numerical value. The algorithm divides this large value
  26. by the CRC-32 polynomial or generator polynomial, leaving the
  27. remainder 32-bit, which is the checksum. 
  28. */
  29. // ----------------------------------------------------------- //   
  30. #ifndef __CRC32_HPP__
  31. #define __CRC32_HPP__
  32.  
  33. #include <iostream.h>
  34. #include <fstream.h>
  35.  
  36. unsigned long calcCRC32(char *buf, unsigned len);
  37. unsigned long calcCRC32(const char *buf, unsigned len);
  38. unsigned long calcCRC32(unsigned char c, unsigned long CRC);
  39. unsigned long calcCRC32(fstream &infile);
  40. int makeCRC32(ostream &stream);
  41.  
  42. #endif  // __CRC32_HPP__
  43. // ----------------------------------------------------------- // 
  44. // ------------------------------- //
  45. // --------- End of File --------- //
  46. // ------------------------------- //
  47.